package top.hjc.orange.repository.config;

import org.modelmapper.ModelMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.jdbc.core.JdbcTemplate;
import top.hjc.orange.repository.support.OrangeJpaRepositoryImpl;

import javax.sql.DataSource;

/**
 * @author: huangjicheng
 * @date: 2025/10/10
 * @desc：
 */
@Configuration
@EnableJpaRepositories(
        basePackages = "top.hjc.orange",
        repositoryBaseClass = OrangeJpaRepositoryImpl.class
)
public class JpaConfig {

    @Bean
    public JdbcTemplate jdbcTemplate(DataSource dataSource) {
        return new JdbcTemplate(dataSource);
    }

    @Bean
    public ModelMapper modelMapper() {
        return new ModelMapper();
    }
}

